<template>
  <div class="index">
    <div class="navlist">
      <ul>

        <router-link to="/Discover">
          <el-button type="info">发现音乐</el-button>
        </router-link>


        <router-link to="/Recommend">
          <el-button type="info">推荐歌单</el-button>
        </router-link>

        <router-link to="/LatestSong">
          <el-button type="info">最新音乐</el-button>
        </router-link>

        <router-link to="/LatestMV">
          <el-button type="info">最新Mv</el-button>
        </router-link>

        <router-link to="/LatestMV">
          <el-button type="info">最新Mv</el-button>
        </router-link>
        <div class="search">
          <img src="../assets/search.png" alt="">
          <div class="border">
          </div>
          <input type="text" placeholder="搜搜你想听的" v-model="inputValue" @keyup.enter="toSearch">
        </div>
      </ul>
    </div>
    <div class="main">
      <router-view></router-view>
    </div>
    <div class="player-control">
      <div class="control">
        <!-- <audio :src='musicUrl' controls autoplay id="musicPlayer"></audio> -->
        
      </div>
      <div class="play">
        <div class="long"></div>
        <div class="cycle">
        </div>
      </div>
      <div class="sound">

      </div>
    </div>
  </div>
</template>

<script>
  export default {
    components: {},
    data() {
      return {
        inputValue: "",
        musicUrl: ' https://music.163.com/song/media/outer/url?id=id.mp3 ',
      }
    },
    methods: {
      toSearch() {
        if (this.inputValue == '') {
          this.$router.push('/Search')
        } else {
          this.$router.push("/result?q=" + this.inputValue)
        }
      }
    }
  }

</script>

<style scoped>
  .index {
    height: 600px;
    width: 1150px;

  }

  .navlist {
    width: 100%;
    height: 100px;
  }

  ul {
    position: fixed;
    left: 4%;
    top: 10%;

  }

  .main {
    position: fixed;
    left: 60px;
    width: 1100px;
    height: 500px;
  }

  a.router-link-active {
    color: rgb(255, 255, 255, 0.6);
  }

  a:LINK {
    color: red;
    text-decoration: none;
  }

  .search {
    position: absolute;
    top: 0px;
    left: 175%;
    width: 80%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 30px;

  }

  .search img {
    position: absolute;
    left: 2%;
    top: 10%;
    width: 10%;
    opacity: 0.5;
  }

  input {
    position: absolute;
    left: 4%;
    top: 19%;
    width: 84%;
    height: 70%;
    background: transparent;
    /* border-radius: 5px; */
    font-size: 14px;
    border: none;
    /* border: 2px solid rgba(255, 255, 255, 0.3); */
    color: rgb(255, 255, 255, 0.7);
    padding: 0 7%;
    outline: none;
    letter-spacing: 3px;
  }

  .border {
    /* border: solid 2px rgb(255, 255, 255,0.3); */
    position: absolute;
    left: 2%;
    top: 20%;
    width: 95%;
    height: 55%;
    border-radius: 5px;
  }

  #musicPlayer {
    width: 100%;
  }
  ::-webkit-scrollbar{
    width: 0px;
  }
  ::-webkit-scrollbar-track{
    width: 0px;
  }
</style>
